/**
 * 
 */
package com.ihg.hiex.entity.session.during;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * @author downpour
 *
 */
@Alias("SessionInBasketAnswerStatus")
public enum SessionInBasketAnswerStatus {
    
    EDITING("editing", "editing"),
    
    FINISH("finish", "finish");
    
    private String alias;
    
    private String description;
    
    /**
     * @param alias
     * @param description
     */
    private SessionInBasketAnswerStatus(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }

    /**
     * 
     * @param alias
     * @return
     */
    public static SessionInBasketAnswerStatus aliasOf(String alias) {
        for(SessionInBasketAnswerStatus sessionInBasketAnswerStatus : SessionInBasketAnswerStatus.values()) {
            if(StringUtils.equalsIgnoreCase(sessionInBasketAnswerStatus.getAlias(), alias)) {
                return sessionInBasketAnswerStatus;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isFinish() {
        return this.equals(FINISH);
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

}
